<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

<h:head>
    <title>vote</title>


</h:head>
<h:body>
    <h:outputText value="VOTE"/>


    <f:view>
        <h:form>

            <h:dataTable value="#{voteBean.parties}" var="party">


                <h:column>
                    <f:facet name="header">Party</f:facet>
                    #{party.name} <br/>
                    #{party.description}
                    <hr/>
                </h:column>

            </h:dataTable>


            <h:selectOneRadio id="Vote" value="#{voteBean.partyId}" layout="pageDirection">
                <f:selectItems value="#{voteBean.myRadioButtonList}"/>
            </h:selectOneRadio>


            <h:commandButton value="Vote" action="#{voteBean.doVote}">
                <f:param name="userId" value="#{userBean.email}"/>
            </h:commandButton>

        </h:form>
    </f:view>
    <h:form>
        <table>
            <tr>
                <td><h:commandButton value="Previous" action="#{voteBean.prevPage}"/></td>
                <td><h:commandButton value="Next" action="#{voteBean.nextPage}"/></td>
            </tr>
        </table>
    </h:form>
</h:body>
</html>